//反向代理 npm install http-proxy-middleware
const  {createProxyMiddleware}  = require('http-proxy-middleware');

module.exports = function(app) {
  app.use(
    '/api',//当使用/api请求时，代理到http://localhost:5000
    createProxyMiddleware({
      target: 'http://localhost:5000',
      changeOrigin: true,
    })
  );
};
